﻿@model Adams.Web.Models.EidPrayers.Index.PageLoad
@{
    Layout = "~/Views/Shared/_ContentLayout.Mobile.cshtml";
}
@section Head{
    <link rel="stylesheet" type="text/css" href="@Url.Content("/Content/Eid/index.css")" />
}
<div id="map">
</div>
@{
    string addresslist = string.Empty;
}
@foreach (var location in Model.Locations)
{
    string maphtml = "<b>" + location.Name + " Eid</b><br/>" + location.Street + " " + (string.IsNullOrEmpty(location.Street2) ? string.Empty : "<br />" + location.Street2) + "<br />" + location.City + " " + location.State + " " + location.ZipCode + "<br/><br/><a href=\\\"http://maps.google.com/maps?q=" + location.Street + " " + location.Street2 + " " + location.City + " " + location.State + " " + location.ZipCode + "\\\">Get Directions</a>";
    var s = location.DisplayOrder.ToString() + "$" + location.Latitude.ToString() + "$" + location.Longitude.ToString() + "$" + maphtml;
    addresslist += "\"" + s + "\",";
    <div class="loc" href="/Prayers/Eid/@Adams.Shared.UrlHelper.Enc(location.Name)">
        <span class="locname">@location.Name</span>
        <br />@location.Street
        @if (!string.IsNullOrEmpty(location.Street2))
        {
            <br />@location.Street2
        }
        <br />@location.City, @location.State @location.ZipCode
        <br />
        <b>
            @foreach (var prayer in location.Prayers)
            {
                @prayer.Time<text> </text>
            }</b>
    </div>
}
<div class="clear">
</div>
@{
    addresslist = addresslist.TrimEnd(',');
}
@section Scripts {
    <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=@Adams.Shared.Config.GetAppSetting("GoogleMapAPIKey")" type="text/javascript"></script>
    <script type="text/javascript">
    var address = new Array(@Html.Raw(addresslist));
    </script>
    <script src="/Scripts/Eid/index.js" type="text/javascript"></script>
}